package com.sqq.jfinalbase;

public class SortOrder {
    private String sort;
    private String order;
    public SortOrder(String name,String order) {
        this.sort=name;
        setOrder(order);
    }
    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getOrder() {
        return order;
    }
    public void setOrder(String order) {
        if(order!=null){
            order=order.toLowerCase();
            if("asc".equals(order)||"desc".equals(order)){
                this.order = order;
            }
        }
    }
    public boolean isOk(){
        return StringUtils.isNotBlank(sort)&&StringUtils.isNotBlank(this.order);
    }
}


